package NewTmas.EditMode;

import NewTmas.Graphs.GraphVizGraph;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * Created by IntelliJ IDEA.
 * User: abhatnag
 * Date: 8/12/11
 * Time: 5:25 PM
 * To change this template use File | Settings | File Templates.
 */
public class CallPreparedCommandSQL extends EditStep
{
    String command;
    Connection con;
    GraphVizGraph graphVizObject;
    String job;


    public CallPreparedCommandSQL(String command, Connection con, GraphVizGraph graphVizObject, String job)
    {
        this.command = command;
        this.con = con;
        this.graphVizObject = graphVizObject;
        this.job = job;
    }


    public void exec() throws SQLException
    {
        Statement st = con.createStatement();
        st.executeUpdate(command);
        st.close();
    }

    @Override
    public String toString()
    {
        return command;
    }
}
